<!doctype html>
<html>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width initial-scale=1'>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link rel="stylesheet" href="markdown.css?v=1641871594082"/>
    <title>负载均衡(upstream)接口</title>
</head>
<body>
<div class="markdown-body">
    <h1>负载均衡(upstream)接口</h1>
<h2>获取upstream分页列表</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/upstream/getPage</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 获取upstream分页列表</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>current</td><td>int32</td><td>当前页数(从1开始)</td><td>true</td><td>-</td></tr>
<tr><td>limit</td><td>int32</td><td>每页数量(默认为10)</td><td>true</td><td>-</td></tr>
<tr><td>keywords</td><td>string</td><td>查询关键字</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/upstream/getPage?keywords=il4qyy&amp;current=7gzzcb&amp;limit=10
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
<tr><td>└─count</td><td>int64</td><td>总记录数</td><td>-</td></tr>
<tr><td>└─curr</td><td>int32</td><td>起始页(从1开始)</td><td>-</td></tr>
<tr><td>└─limit</td><td>int32</td><td>每页记录数</td><td>-</td></tr>
<tr><td>└─records</td><td>array</td><td>列表内容</td><td>-</td></tr>
<tr><td>     └─id</td><td>string</td><td>主键</td><td>-</td></tr>
<tr><td>     └─name</td><td>string</td><td>负载均衡名称</td><td>-</td></tr>
<tr><td>     └─tactics</td><td>string</td><td>负载策略: '':无(默认) 'sticky':会话保持 'ip_hash':ip绑定 'least_conn':最少连接 'least_time':最短时间</td><td>-</td></tr>
<tr><td>     └─proxyType</td><td>int32</td><td>代理类型 0:http(默认) 1:tcp/udp</td><td>-</td></tr>
<tr><td>     └─monitor</td><td>int32</td><td>监控邮件通知 0:否(默认) 1:是</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;35c1i9&quot;,
	&quot;msg&quot;:&quot;sv9i6d&quot;,
	&quot;obj&quot;:{
		&quot;count&quot;:788,
		&quot;curr&quot;:672,
		&quot;limit&quot;:10,
		&quot;records&quot;:[
			{
				&quot;id&quot;:&quot;45&quot;,
				&quot;name&quot;:&quot;鹤轩.白&quot;,
				&quot;tactics&quot;:&quot;iytgxk&quot;,
				&quot;proxyType&quot;:355,
				&quot;monitor&quot;:427
			}
		]
	}
}
</code></pre>
<h2>添加或编辑upstream</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/upstream/insertOrUpdate</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 添加或编辑upstream</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>主键</td><td>false</td><td>-</td></tr>
<tr><td>name</td><td>string</td><td>负载均衡名称</td><td>true</td><td>-</td></tr>
<tr><td>tactics</td><td>string</td><td>负载策略: '':无(默认) 'sticky':会话保持 'ip_hash':ip绑定 'least_conn':最少连接 'least_time':最短时间</td><td>false</td><td>-</td></tr>
<tr><td>proxyType</td><td>int32</td><td>代理类型 0:http(默认) 1:tcp/udp</td><td>false</td><td>-</td></tr>
<tr><td>monitor</td><td>int32</td><td>监控邮件通知 0:否(默认) 1:是</td><td>false</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/upstream/insertOrUpdate?monitor=375&amp;seq=601&amp;name=鹤轩.白&amp;createTime=1641871596310&amp;proxyType=161&amp;updateTime=1641871596310&amp;id=45&amp;tactics=u1w8hj
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;exbvq7&quot;,
	&quot;msg&quot;:&quot;ztgxoa&quot;,
	&quot;obj&quot;:{
		
	}
}
</code></pre>
<h2>删除upstream</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/upstream/delete</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 删除upstream</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>upstream的id</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/upstream/delete?id=45
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;d7usdq&quot;,
	&quot;msg&quot;:&quot;8w31e6&quot;,
	&quot;obj&quot;:{
		
	}
}
</code></pre>
<h2>根据upstreamId获取server列表</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/upstream/getServerByUpstreamId</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 根据upstreamId获取server列表</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>upstreamId</td><td>string</td><td>upstream的id</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/upstream/getServerByUpstreamId?upstreamId=45
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
<tr><td>└─id</td><td>string</td><td>主键</td><td>-</td></tr>
<tr><td>└─upstreamId</td><td>string</td><td>负载均衡upstream的id</td><td>-</td></tr>
<tr><td>└─server</td><td>string</td><td>负载节点ip (例:10.10.10.1)</td><td>-</td></tr>
<tr><td>└─port</td><td>int32</td><td>负载节点端口 (例:8080)</td><td>-</td></tr>
<tr><td>└─weight</td><td>int32</td><td>负载节点权重</td><td>-</td></tr>
<tr><td>└─failTimeout</td><td>int32</td><td>失败等待时间,秒</td><td>-</td></tr>
<tr><td>└─maxFails</td><td>int32</td><td>最大失败次数</td><td>-</td></tr>
<tr><td>└─maxConns</td><td>int32</td><td>最大连接数</td><td>-</td></tr>
<tr><td>└─status</td><td>string</td><td>状态策略 'none':无(默认) 'down':停用 'backup':备用</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;id0wta&quot;,
	&quot;msg&quot;:&quot;f09dys&quot;,
	&quot;obj&quot;:[
		{
			&quot;id&quot;:&quot;45&quot;,
			&quot;upstreamId&quot;:&quot;45&quot;,
			&quot;server&quot;:&quot;37yflf&quot;,
			&quot;port&quot;:78,
			&quot;weight&quot;:848,
			&quot;failTimeout&quot;:107,
			&quot;maxFails&quot;:943,
			&quot;maxConns&quot;:174,
			&quot;status&quot;:&quot;4ters3&quot;
		}
	]
}
</code></pre>
<h2>添加或编辑server</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/upstream/insertOrUpdateServer</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 添加或编辑server</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>主键</td><td>false</td><td>-</td></tr>
<tr><td>upstreamId</td><td>string</td><td>负载均衡upstream的id</td><td>true</td><td>-</td></tr>
<tr><td>server</td><td>string</td><td>负载节点ip (例:10.10.10.1)</td><td>true</td><td>-</td></tr>
<tr><td>port</td><td>int32</td><td>负载节点端口 (例:8080)</td><td>true</td><td>-</td></tr>
<tr><td>weight</td><td>int32</td><td>负载节点权重</td><td>false</td><td>-</td></tr>
<tr><td>failTimeout</td><td>int32</td><td>失败等待时间,秒</td><td>false</td><td>-</td></tr>
<tr><td>maxFails</td><td>int32</td><td>最大失败次数</td><td>false</td><td>-</td></tr>
<tr><td>maxConns</td><td>int32</td><td>最大连接数</td><td>false</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>状态策略 'none':无(默认) 'down':停用 'backup':备用</td><td>false</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/upstream/insertOrUpdateServer?upstreamId=45&amp;createTime=1641871596310&amp;maxConns=830&amp;id=45&amp;weight=735&amp;status=briecg&amp;port=391&amp;updateTime=1641871596310&amp;failTimeout=538&amp;maxFails=420&amp;server=glqt6c&amp;monitorStatus=608
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;hm8psm&quot;,
	&quot;msg&quot;:&quot;shliao&quot;,
	&quot;obj&quot;:{
		&quot;waring&quot;:&quot;You may have used non-display generics.&quot;
	}
}
</code></pre>

    <footer class="page-footer">
        <span class="copyright">Generated by smart-doc at 2022-01-11 11:26:34</span>
        <span class="footer-modification">Suggestions, contact, support and error reporting on
            <a href="https://gitee.com/smart-doc-team/smart-doc" target="_blank">Gitee</a> or
            <a href="https://github.com/smart-doc-group/smart-doc" target="_blank">Github</a>
        </span>
    </footer>
</div>
</body>
</html>